package config;

import hibernate.IDao;

import java.util.HashMap;
import java.util.Map;

import models.User;

import org.springframework.context.ApplicationContext;
import org.springframework.context.MessageSource;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cache.Cache;

public class Constant {
	
	//系统常量
	public static String LOGININFO = "LOGININFO";
	public static String LOGIN_URL = "login.jsp";
	
	public static final String SA = "sa";
	public static final String FALSE = "false";
	public static final String TRUE = "true";
	public static Map<String,String> OUR_URL_MAP = new HashMap<String, String>();
	public static boolean SHOW_ALL_CATEGORG = false;
	public static boolean IGNORE_BLANK_URL_CATEGORG = false;
	
	//系统变量
	public static String CONFIG_PATH;
	public static String ROOT_ZONE_CODE;
	public static int PAGE_SIZE = 15;
	
	public static Map<String, String> zoneMap = new HashMap<String, String>();
	
	public static Cache<String, Cache<String,String>> dictCache = new Cache<String, Cache<String,String>>();
	
	//系统引用
	public static ApplicationContext AppContext;
	public static MessageSource MESSAGE;
	public static String TEMP_PATH;
	
	
	public static void main(String[] args){
		ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath*:conf/applicationContext.xml");
		System.out.println(123);
		IDao  dao = (IDao)ctx.getBean("commonDAO");
		System.out.println(dao);
		User orgUser = dao.findFirst(User.class, null, "", null);
		System.out.println(orgUser);
	}
	
}
